home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeAddSelectionAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.5 KB  |  47 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.tree.TreePath;
  6.  
  7. class BasicTreeUI$TreeAddSelectionAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.    private boolean changeAnchor;
  11.  
  12.    public BasicTreeUI$TreeAddSelectionAction(BasicTreeUI var1, String var2, boolean var3) {
  13.       this.this$0 = var1;
  14.       this.changeAnchor = var3;
  15.    }
  16.  
  17.    public void actionPerformed(ActionEvent var1) {
  18.       int var2 = this.this$0.getRowCount(this.this$0.tree);
  19.       if (this.this$0.tree != null && var2 > 0) {
  20.          int var3 = BasicTreeUI.access$5(this.this$0);
  21.          TreePath var4 = BasicTreeUI.access$9(this.this$0);
  22.          TreePath var5 = BasicTreeUI.access$4(this.this$0);
  23.          if (var3 == -1) {
  24.             var3 = 0;
  25.          }
  26.  
  27.          if (!this.changeAnchor) {
  28.             if (this.this$0.tree.isRowSelected(var3)) {
  29.                this.this$0.tree.removeSelectionRow(var3);
  30.                BasicTreeUI.access$3(this.this$0, var5);
  31.             } else {
  32.                this.this$0.tree.addSelectionRow(var3);
  33.             }
  34.  
  35.             BasicTreeUI.access$2(this.this$0, var4);
  36.          } else {
  37.             this.this$0.tree.setSelectionRow(var3);
  38.          }
  39.       }
  40.  
  41.    }
  42.  
  43.    public boolean isEnabled() {
  44.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  45.    }
  46. }
  47.